package com.elitel.frame.base.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;


import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.annotation.Resource;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Service;

import com.elitel.frame.base.service.CensusService;
import com.elitel.frame.core.common.DateUtil;
import com.elitel.frame.main.dao.BaseStaaddonsMapper;
import com.elitel.frame.main.dao.BaseStaconfigMapper;
import com.elitel.frame.main.dao.CfgExtstaMapper;
import com.elitel.frame.main.dao.CfgFieldMapper;
import com.elitel.frame.main.dao.CfgTableMapper;
import com.elitel.frame.main.dao.ext.ColumnMapper;
import com.elitel.frame.main.dao.ext.ExtCfgDbMapper;
import com.elitel.frame.main.dao.ext.ExtCfgTableMapper;
import com.elitel.frame.main.entity.BaseStaaddons;
import com.elitel.frame.main.entity.BaseStaconfig;
import com.elitel.frame.main.entity.CfgExtsta;
import com.elitel.frame.main.entity.CfgField;
import com.elitel.frame.main.entity.ext.Census;
import com.elitel.frame.main.entity.ext.Column;
import com.elitel.frame.main.entity.ext.ReturnData;
import com.elitel.frame.main.entity.ext.StaAddons;
import com.elitel.frame.main.entity.vo.PageResponseVo;
import com.google.gson.Gson;
/**
 * 报表配置服务service
 * @author dingdaifu
 *
 */
@Service
public class CensusServiceImpl implements CensusService {

	@Resource
	private CfgExtstaMapper cfgExtstaMapper;
	
	@Resource
	private ExtCfgDbMapper extCfgDbMapper;
	
	@Resource
	private BaseStaconfigMapper baseStaconfigMapper;
	
	@Resource
	private ColumnMapper columnMapper;
	
	@Resource
	private CfgFieldMapper cfgFieldMapper;
	
	@Resource
	private CfgTableMapper cfgTableMapper;
	
	@Resource
	private ExtCfgTableMapper extCfgTableMapper;
	
	@Resource
	private BaseStaaddonsMapper baseStaaddonsMapper;
	
	@Override
	public String insertField(CfgExtsta cfgExtsta) {
		String message = "fail";
		String guid = String.valueOf(System.currentTimeMillis());
		Date date = new Date();
		String dates = DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
		cfgExtsta.setCreatedate(dates);
		if(cfgExtsta.getCreateuser()==null){
			cfgExtsta.setCreateuser("user");
		}
		int a = cfgExtstaMapper.insertSelective(cfgExtsta);
		if (a>0) {
			message = "success";
		}
		return message;
	}

	@Override
	public String deleteField(String guid) {
		String message = "fail";
		int a = cfgExtstaMapper.deleteByPrimaryKey(guid);
		if (a>0) {
			message = "success";
		}
		return message;
	}

	@Override
	public String updateField(CfgExtsta cfgExtsta) {
		String message = "fail";
		int a = cfgExtstaMapper.updateByPrimaryKeySelective(cfgExtsta);
		if (a>0) {
			message = "success";
		}
		return message;
	}

	@Override
	public List<Census> selectField() {
		Map<String, List<Census>> map = new HashMap<String, List<Census>>();
		List<Census> list1 = extCfgDbMapper.getTreeNode();
		List<Census> list2 = new ArrayList<Census>();
		int i = 0;
		for(Census census :list1){
			String dbKey = census.getId();
			census.setName(census.getName()+"("+census.getId()+")");
			//int count = cfgExtstaMapper.getCount(dbKey);
			int count =1;
			if (count>0) {
				List<Census> list = cfgExtstaMapper.getMap(dbKey);
				census.setChildren(list);
				for(Census census2:list){
					census2.setPid(census.getId());
					list2.add(census2);
				}
			}
		}
		map.put("list1", list1);
		return list1;
	}
	
	
	@Override
	public String updateStaConfig(BaseStaconfig baseStaconfig) {
		String message = "fail";
		String xformart = baseStaconfig.getXfield();
		baseStaconfig.setXformart(xformart);
		baseStaconfig.setGuid( baseStaconfigMapper.selectTableStaConfigOne(baseStaconfig.getGuid()).getGuid());
		int a = baseStaconfigMapper.updateByPrimaryKeySelective(baseStaconfig);
		if (a>0) {
			message ="success";
		}
		return message;
	}

	@Override
	public PageResponseVo<BaseStaconfig> selectTableStaConfig(String sguid,
			String pageNo, String pageSize) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<String> lists = extCfgDbMapper.getDbKey();
		List<String> listad=null;
		List<BaseStaconfig> list = null;
		int count = 0;
		if (lists.contains(sguid)) {
			listad = cfgExtstaMapper.getGuidList(sguid);
			if (listad.size()==0) {
				list = new ArrayList<BaseStaconfig>();
			}else {
				int a = Integer.parseInt(pageNo);
				int b = Integer.parseInt(pageSize);
				int lineStart = (a-1)*b+1;
				int lineEnd = a*b;
				map.put("lineStart", lineStart);
				map.put("lineEnd", lineEnd);
				map.put("type", listad);
				list = baseStaconfigMapper.selectTableStaConfigList(map);
				count = baseStaconfigMapper.selectCountss(map);
			}
		}else{
			int a = Integer.parseInt(pageNo);
			int b = Integer.parseInt(pageSize);
			int lineStart = (a-1)*b+1;
			int lineEnd = a*b;
			map.put("lineStart", lineStart);
			map.put("lineEnd", lineEnd);
			map.put("sguid", sguid);
			list = baseStaconfigMapper.selectTableStaConfig(map);
			count = baseStaconfigMapper.selectCount(sguid);
		}
		for(BaseStaconfig cStaconfig :list){
			String cool = cStaconfig.getDtConfigId();
			cStaconfig.setDtConfigId(getBiaoChinese(cStaconfig.getDtConfigId()));
			cStaconfig.setXfield(getColumnChinese(cStaconfig.getXfield(),cool));
			cStaconfig.setXformart(getColumnChinese(cStaconfig.getXformart(),cool));
			cStaconfig.setXcaption(getColumnChinese(cStaconfig.getXcaption(),cool));
			cStaconfig.setYfield(getColumnChinese(cStaconfig.getYfield(),cool));
			cStaconfig.setYcaption(getColumnChinese(cStaconfig.getYcaption(),cool));
		}
		PageResponseVo<BaseStaconfig> pageResponseVo = new PageResponseVo<BaseStaconfig>();
		pageResponseVo.setTotal(count);
		pageResponseVo.setRows(list);
		return pageResponseVo;
	}
	
	@Override
	public BaseStaconfig selectOneStaConfig(String guid) {
		BaseStaconfig baseStaconfig = baseStaconfigMapper.selectTableStaConfigOne(guid);
		return baseStaconfig;
	}

	@Override
	public String deleteStaConfig(String guid) {
		String message = "fail";
		int a = baseStaconfigMapper.deleteByPrimaryKey(baseStaconfigMapper.selectTableStaConfigOne(guid).getGuid());
		if (a>0) {
			message = "success";
		}
		return message;
	}

	@Override
	public String insertStaConfig(BaseStaconfig baseStaconfig) {
		String message = "fail";
		String guid = String.valueOf(System.currentTimeMillis());
		String xformart = baseStaconfig.getXfield();
		String config = baseStaconfig.getDtConfigId();
		Date date = new Date();
		String createdate = DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
		if (baseStaconfig.getCreateuser()==null) {
			baseStaconfig.setCreateuser("user");
		}
		baseStaconfig.setGuid(guid);
		baseStaconfig.setSguid(baseStaconfig.getSguid());
		baseStaconfig.setXformart(xformart);
		baseStaconfig.setCreatedate(createdate);
//		if(baseStaconfig.getRemark()!=null&&!"".equals(baseStaconfig.getRemark())){
//			JSONObject jsonObject = JSONObject.fromObject(baseStaconfig.getRemark());
//			Map<String, String> map = jsonObject;
//			Map<String, Object> columnMap = new HashMap<String, Object>();
//			for(Map.Entry<String, String> entry:map.entrySet()){
//				Map<String, String> map2 = new HashMap<String, String>();
//				map2.put("key", entry.getKey());
//				map2.put("dtConfigId", baseStaconfig.getDtConfigId());
//				String xx = cfgFieldMapper.selectColumnCN(map2);
//				columnMap.put(entry.getKey(), xx);
//			}
//			 JSONObject jsonObjecting=JSONObject.fromObject(columnMap);
//			 baseStaconfig.setColumnmap(jsonObjecting.toString());
//		}
		int a = baseStaconfigMapper.insertSelective(baseStaconfig);
		if (a>0) {
			message = "success";
		}
		return message;
	}

	@Override
	public Map<String, Object> getCensusXY(String configid) {
		String tableName = cfgTableMapper.getTableNamees(configid);
		List<Column> list = columnMapper.getColumn(tableName);
		Map<String, Object> map = new HashMap<String, Object>();
		List<String> xfield = new ArrayList<String>();
		List<String> yfield = new ArrayList<String>();
		for(Column column:list){
			if ("NUMBER".equals(column.getType().toUpperCase())) {
				yfield.add(column.getColumnName());
			}
			xfield.add(column.getColumnName());
		}
		Map<String, Object> mapx = new HashMap<String, Object>();
		Map<String, Object> mapy = new HashMap<String, Object>();
		for (String x :xfield) {
			mapx.put(x, getColumnChinese(x,configid));
		}
		for(String y:yfield){
			mapy.put(y, getColumnChinese(y,configid));
		}
		map.put("xfield", mapx);
		map.put("yfield", mapy);
		return map;
	}

	@Override
	public List<String> selectTableName(String dbKey) {
		List<String> listed = extCfgDbMapper.getDbKey();
		List<String> list = null;
		if (listed.contains(dbKey)) {
			list = cfgTableMapper.selectTableName(dbKey);
		}else {
			String aaaString = cfgExtstaMapper.selectDBkey(dbKey);
			list = cfgTableMapper.selectTableName(aaaString);
		}
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		return list;
	}
	
	@Override
	public List<String> selectTableNames(String dbKey) {
		List<String> list = cfgTableMapper.selectTableName(dbKey);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		return list;
	}
	
	@Override
	public CfgExtsta selectOneField(String guid) {
		CfgExtsta cfgExtsta = cfgExtstaMapper.selectByPrimaryKey(guid);
		return cfgExtsta;
	}

	@Override
	public List<String> selectWher(String guid) {
		Map<String, Object> map = new HashMap<String, Object>();
		String message = baseStaconfigMapper.selectWher(guid);
		String aa = message.substring(5);
		String[] bb = aa.split("and");
		// GUID > ce15
		List<String> ads = new ArrayList<String>();
		List<String> bds = new ArrayList<String>();
		List<String> cds = new ArrayList<String>();
		List<String> ccList = Arrays.asList(bb);
		for(String ss :ccList){
			int a = getFromIndex(ss," ",1);
			int b = getFromIndex(ss," ",2);
			int c = getFromIndex(ss," ",3);
			String ad = ss.substring(a+1, b);
			String bd = ss.substring(b+1, c);
			String cd = ss.substring(c+1,ss.length()-1);
			ads.add(ad);
			bds.add(bd);
			cds.add(cd);
		}
		map.put("ads", ads);
		map.put("bds", bds);
		map.put("cds", cds);
		return ads;
	}
	
    
  //子字符串modelStr在字符串str中第count次出现时的下标  
    public static int getFromIndex(String str, String modelStr, Integer count) {  
    	System.out.println(str.length());
        //对子字符串进行匹配  
            Matcher slashMatcher = Pattern.compile(modelStr).matcher(str);  
        int index = 0;  
            //matcher.find();尝试查找与该模式匹配的输入序列的下一个子序列  
           while(slashMatcher.find()) {  
            index++;  
            //当modelStr字符第count次出现的位置  
            if(index == count){  
               break;  
            }  
        }  
            //matcher.start();返回以前匹配的初始索引。  
           return slashMatcher.start();  
    }  

	@Override
	public Map<String, Object> selectWheMapr(String sdb,String guid) {
		String message = baseStaconfigMapper.selectWher(guid);
		String aa = message.substring(5);
		String[] bb = aa.split("and");
		// GUID > ce15
		List<String> ccList = Arrays.asList(bb);
		Map<String, Object> map2 = new HashMap<String, Object>();
		Map<String, Map<String, Object>> map3 = new HashMap<String, Map<String,Object>>();
		for(String ss :ccList){
			int a = getFromIndex(ss," ",1);
			int b = getFromIndex(ss," ",2);
			int c = getFromIndex(ss," ",3);
			String ad = ss.substring(a+1, b);
			String bd = ss.substring(b+1, c);
			String cd = ss.substring(c+1,ss.length()-1);
			map2.put("bd", bd);
			map2.put("cd", cd);
			map3.put(ad, map2);
		}
		Map<String, Object> map = map3.get(sdb);
		return map;
	}  
	
	public  String getColumnChinese(String column,String tableName){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("column", column);
		map.put("tableName", tableName);
		String columnChinese = cfgFieldMapper.getColumnChinese(map);
		return columnChinese;		
	}
	
	
	public  String getBiaoChinese(String biao){
		String biaoChinese = cfgTableMapper.getBiaoChinese(biao);
		return biaoChinese;	
	}

	@Override
	public Map<String, Object> selectTableNameMap(List<String> list) {
		Map<String, Object> map = new HashMap<String, Object>();
		for(String a:list){
			map.put(a, getBiaoChinese(a));
		}
		return map;
	}

	@Override
	public Map<String, Object> selectTableMap(List<String> list) {
		Map<String, Object> map = new HashMap<String, Object>();
		for (String a : list) {
			map.put(a, getBiaoChinese(a));
		}
		return map;
	}

	@Override
	public String getDbKeyes(String serviceID) {
		String xx = cfgExtstaMapper.getDbKeyes(serviceID);
		return xx;
	}

	@Override
	public String getCensusType(String column, String table) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("column", column);
		map.put("table", table);
		String message = cfgFieldMapper.getCensusType(map);
		return message;
	}

	@Override
	public String selectcolumning(String sdb, String guid) {
		BaseStaconfig baseStaconfig =baseStaconfigMapper.selectTableStaConfigOne(guid);
		String remake = baseStaconfig.getRemark();
		Gson gson = new Gson();
	    Map<String, String> map = new HashMap<String, String>();
	    map = gson.fromJson(remake, map.getClass());
	    String message = "";
	    if (map!=null) {
	    	message = (String) map.get(sdb);
		}
		return message;
	}

	@Override
	public List<String> selectcolumned(String guid) {
		BaseStaconfig baseStaconfig = baseStaconfigMapper.selectTableStaConfigOne(guid);
		String remake = baseStaconfig.getColumnmap();
		Gson gson = new Gson();
	    Map<String, String> map = new HashMap<String, String>();
	    map = gson.fromJson(remake, map.getClass());
	    List<String> message = new ArrayList<String>();
	    if (map!=null) {
	    	for(Map.Entry<String, String> entry:map.entrySet()){
		    	message.add(entry.getKey());
		    }
		}
	    return message;
	}

	@Override
	public String exitid(String guid) {
		String message = "fail";
		int a = cfgExtstaMapper.exitid(guid);
		if (a>0) {
			message = "success";
		}
		return message;
	}

	@Override
	public BaseStaconfig selectTableStaConfigOne(String guid) {
		BaseStaconfig baseStaconfig = baseStaconfigMapper.selectTableStaConfigOne(guid);
		if (baseStaconfig!=null) {
			baseStaconfig.setDtConfigId(getBiaoChinese(baseStaconfig.getDtConfigId()));
		}
		return baseStaconfig;
	}

	@Override
	public List<StaAddons> selectColumnList(String guid,String sguid) {
		List<StaAddons> list = new ArrayList<>();
		BaseStaconfig staconfig = baseStaconfigMapper.selectTableStaConfigOne(guid);
		if (staconfig!=null) {
			List<CfgField> cfglist = cfgFieldMapper.selectColumnList(staconfig.getDtConfigId());
			JSONObject jsonObject = JSONObject.fromObject(staconfig.getColumnmap());
			Map<String, String> map = (Map<String, String>)jsonObject;
			List<BaseStaaddons> list2 = baseStaaddonsMapper.selectAlDons(staconfig.getGuid());
			if (cfglist!=null&&cfglist.size()>0) {
				for(CfgField c:cfglist){
					StaAddons staAddons = new StaAddons();
					staAddons.setColumn(c.getDfName());
					staAddons.setColumnCN(c.getDfNameCn());
					staAddons.setType(c.getDtType());
					if("string".equals(c.getDtType())){
						staAddons.setColumnType(0);
					}else if ("date".equals(c.getDtType())) {
						staAddons.setColumnType(0);
					}else {
						staAddons.setColumnType(0);
					}
					for(Map.Entry<String, String> entry:map.entrySet()){
						if (entry.getKey().equals(c.getDfName())) {
							staAddons.setRemake("1");
						}
					}
//					if (list2.size()>0) {
//						for(BaseStaaddons b:list2){
//							if (b.getColumn().equals(staAddons.getColumn())) {
//								staAddons.setRemake("1");
//							}
//						}
//					}
					list.add(staAddons);
				}
			}
		}
		return list;
	}

	@Override
	public String getkeys(String sguid) {
		BaseStaconfig baseStaconfig = baseStaconfigMapper.selectTableStaConfigOne(sguid);
		String xString = "";
		if (baseStaconfig!=null) {
			xString = baseStaconfig.getDtConfigId();
		}
		return xString;
	}

	@Override
	public Map<String, String> selectColumnType(String valu, String keys) {
		Map<String, String> map = new HashMap<>();
		return null;
	}

	/* (non-Javadoc)
	 * @see com.elitel.frame.base.service.CensusService#insertDataClick(java.util.List)
	 */
	@Override
	public String insertDataClick(List<StaAddons> staAddons) {
		String message = "fail";
		int a = 0;
		for(StaAddons sAddons:staAddons){
			BaseStaaddons baseStaaddons = new BaseStaaddons();
			String guid = String.valueOf(System.currentTimeMillis());
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			baseStaaddons.setGuid(guid);
			baseStaaddons.setColumnCn(sAddons.getColumnCN());
			baseStaaddons.setColumn(sAddons.getColumn());
			baseStaaddons.setColumnType(sAddons.getColumnType());
			baseStaaddons.setRemake(sAddons.getRemake());
			baseStaaddons.setType(sAddons.getType());
			BaseStaconfig baseStaconfigs = baseStaconfigMapper.selectTableStaConfigOne(sAddons.getsGuid());
			baseStaaddons.setSguid(baseStaconfigs.getGuid());
			int as = 0;
			Map<String, Object> map = new HashMap<>();
			map.put("guid", baseStaconfigs.getGuid());
			map.put("column", sAddons.getColumn());
			as = baseStaaddonsMapper.selectCount(map);
			int b = 0;
			if (as==0) {
				 b= baseStaaddonsMapper.insertSelective(baseStaaddons);
			}
			a +=b;
		}
			message ="success";
		return message;
	}

	@Override
	public List<StaAddons> selectColumnTableBiao(String guid, String sguid) {
		List<StaAddons> list = new ArrayList<>();
		BaseStaconfig staconfig = baseStaconfigMapper.selectTableStaConfigOne(guid);
		List<CfgField> cfglist = cfgFieldMapper.selectColumnList(staconfig.getDtConfigId());
		Map<String, String> map = new HashMap<>();
		BaseStaconfig baseStaconfigs = baseStaconfigMapper.selectTableStaConfigOne(guid);
		List<BaseStaaddons> list2 = baseStaaddonsMapper.selectAlDons(baseStaconfigs.getGuid());
		for(CfgField c:cfglist){
			StaAddons staAddons = new StaAddons();
			staAddons.setColumn(c.getDfName());
			staAddons.setColumnCN(c.getDfNameCn());
			staAddons.setType(c.getDtType());
			if("string".equals(c.getDtType())){
				staAddons.setColumnType(0);
			}else if ("date".equals(c.getDtType())) {
				staAddons.setColumnType(0);
			}else {
				staAddons.setColumnType(0);
			}
//			for(Map.Entry<String, String> entry:map.entrySet()){
//				if (entry.getKey().equals(c.getDfName())) {
//					staAddons.setRemake("1");
//				}
//			}
			for(BaseStaaddons b:list2){
				if (b.getColumn().equals(staAddons.getColumn())) {
					staAddons.setRemake("1");
				}
			}
			list.add(staAddons);
		}
		return list;
	}

	@Override
	public Map<String, Object> getCensusTableColumns(String serviceString) {
		Map<String, Object> map = new HashMap<>();
		CfgExtsta cfgExtsta = cfgExtstaMapper.selectByPrimaryKey(serviceString);
		BaseStaconfig staconfig = baseStaconfigMapper.selectTableStaConfigOne(serviceString);
		List<BaseStaaddons> list2 = baseStaaddonsMapper.selectAlDons(staconfig.getGuid());
		map.put(cfgExtsta.getStitle(), list2);
		return map;
	}
	
	@Override
	public Map<String, Object> getSelectCensusTableColumns(String guid) {
		Map<String, Object> maps = new HashMap<>();
		List<StaAddons> list = new ArrayList<>();
		CfgExtsta cfgExtsta = cfgExtstaMapper.selectByPrimaryKey(guid);
		BaseStaconfig staconfig = baseStaconfigMapper.selectTableStaConfigOne(guid);
		List<CfgField> cfglist = cfgFieldMapper.selectColumnList(staconfig.getDtConfigId());
		JSONObject jsonObject = JSONObject.fromObject(staconfig.getColumnmap());
		Map<String, String> map = (Map<String, String>)jsonObject;
		List<BaseStaaddons> list2 = baseStaaddonsMapper.selectAlDons(staconfig.getGuid());
		for(CfgField c:cfglist){
			StaAddons staAddons = new StaAddons();
			staAddons.setColumn(c.getDfName());
			staAddons.setColumnCN(c.getDfNameCn());
			staAddons.setType(c.getDtType());
			if("string".equals(c.getDtType())){
				staAddons.setColumnType(2);
			}else if ("date".equals(c.getDtType())) {
				staAddons.setColumnType(1);
			}else {
				staAddons.setColumnType(4);
			}
			for(Map.Entry<String, String> entry:map.entrySet()){
				if (entry.getKey().equals(c.getDfName())) {
					staAddons.setRemake("1");
					if (list2.size()>0) {
						for(BaseStaaddons b:list2){
							if (b.getColumn().equals(staAddons.getColumn())) {
								staAddons.setRemake("1");
							}
						}
					}
					list.add(staAddons);
				}
			}
		}
		maps.put(cfgExtsta.getStitle(), list);
		return maps;
	}

	@Override
	public Map<String, Object> getCensusColumn(String serviceID) {
		String censusColumn = baseStaconfigMapper.getCensusColumn(serviceID);
		JSONObject jsonObject= JSONObject.fromObject(censusColumn);
		Map<String, Object> map = (Map<String, Object>)jsonObject;
		return map;
	}

	@Override
	public int selectcensusone(String xx) {
		int a = baseStaconfigMapper.selectcensusone(xx);
		return a;
	}

	@Override
	public List<ReturnData> getTableColumnBiao(String id) {
		BaseStaconfig staconfig = baseStaconfigMapper.selectTableStaConfigOne(id);
		List<BaseStaaddons> list2 = baseStaaddonsMapper.selectAlDons(staconfig.getGuid());
		List<ReturnData> list = new ArrayList<>();
		for(BaseStaaddons b:list2){
			ReturnData returnData = new ReturnData();
			returnData.setFieldname(b.getColumn());
			returnData.setFieldnamecn(b.getColumnCn());
			returnData.setFieldtype(b.getType());
			returnData.setShowtype(b.getColumnType());
			list.add(returnData);
		}
		return list;
	}

	@Override
	public Map<String, Object> selectXYMap(String id) {
		BaseStaconfig staconfig = baseStaconfigMapper.selectTableStaConfigOne(id);
		Map<String, Object> map = new HashMap<>();
		map.put("xcolumn", staconfig.getXcaption());
		map.put("ycolumn", staconfig.getYcaption());
		return map;
	}


}
